export const schema = {
    type: "page",
    title: "模块管理",
    body: [
        {
            type: "nav",
            stacked: false,
            links: [
                {
                    label: "编辑",
                    to: "/org/edit/${id}"
                },
                {
                    label: "设置",
                    to: "/org/setting/${id}"
                },
                {
                    label: "自定义认证信息",
                    to: "/org/infosetting/${id}"
                },
                {
                    label: "微信模板信息设置",
                    to: "/org/wechatmessage/${id}"
                },
            ]
        },

        {
            type: "wrapper",
            className: "b-l b-b b-r bg-white no-padder",
            body: {
                panelClassName: 'no-border m-b-none',
                api: "post:/api/org/${id}/settings",
                initApi: "get:/api/org/${id}",
                // redirect: "/org/list",
                submitText: "",
                name: "theform",
                type: "form",
                title: "",
                actions: [
                    {
                        type: "submit",
                        primary: true,
                        label: "保存",
                        icon: "fa fa-save pull-left"
                    }
                ],
                collapsable: true,
                fieldSet: [
                    {
                        collapsed: false,
                        className: 'm-t',
                        title: '微信公众号设置',
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: 'text',
                                name: 'wechat_app_id',
                                label: '微信 App Id'
                            },
                            {
                                type: 'password',
                                name: 'wechat_app_secret',
                                label: '微信 App Secret',
                                disableAutoFill: true
                            },

                            {
                                type: 'static-text',
                                name: 'wechat_app_url',
                                visibleOn: 'data.wechat_app_url',
                                label: '业务域名',
                                copyable: true
                            },

                            {
                                type: 'file',
                                name: 'wechat_verify_file',
                                label: '微信验证文件'
                            }
                        ]
                    },
                    {
                        title: '团队星级认证设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: 'checkbox',
                                name: 'team_star_open',
                                option: "是否开启团队星级认证",
                                trueValue: 1,
                                falseValue: 0
                            },
                            {
                                type: 'text',
                                name: 't1',
                                label: '1星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 't2',
                                label: '2星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 't3',
                                label: '3星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 't4',
                                label: '4星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: '5',
                                label: '5星所需志愿时长'
                            },
                        ]
                    },
                    {
                        title: '志愿者星级认证设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: 'checkbox',
                                name: 'volunteer_star_open',
                                option: "是否开启志愿者星级认证",
                                trueValue: 1,
                                falseValue: 0
                            },
                            {
                                type: 'text',
                                name: 'v1',
                                label: '1星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v2',
                                label: '2星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v3',
                                label: '3星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v4',
                                label: '4星所需志愿时长'
                            },
                            {
                                type: 'text',
                                name: 'v5',
                                label: '5星所需志愿时长'
                            },
                        ]
                    },
                    {
                        title: '商户设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: 'text',
                                name: 'wechat_payment_merchant_id',
                                label: '微信支付商户号'
                            },
                            {
                                type: 'password',
                                name: 'wechat_payment_key',
                                label: 'API密钥',
                                disableAutoFill: true
                            },
                        ]
                    },

                    {
                        title: '兑吧设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: 'text',
                                name: 'duiba_key',
                                label: '兑吧 Key'
                            },

                            {
                                type: 'text',
                                name: 'duiba_secret',
                                label: '兑吧 Secret'
                            },

                            {
                                type: 'form',
                                label: '积分规则',
                                name: 'score_settings',
                                btnLabel: '设置积分规则',
                                requiredOn: 'data.duiba_key || data.duiba_secret',
                                form: {
                                    title: '设置积分规则',
                                    controls: [
                                        {
                                            type: 'text',
                                            name: 'register',
                                            label: '注册',
                                            value: '10',
                                            required: true,
                                            addOn: {
                                                label: '星币'
                                            }
                                        },
                                        {
                                            type: 'text',
                                            name: 'certification',
                                            label: '实名认证',
                                            value: '10',
                                            required: true,
                                            addOn: {
                                                label: '星币'
                                            }
                                        },
                                        {
                                            type: 'text',
                                            name: 'reward_time',
                                            label: '获得志愿时长',
                                            value: '10',
                                            required: true,
                                            addOn: {
                                                label: '星币每小时'
                                            }
                                        },
                                        {
                                            type: 'text',
                                            name: 'project_hire',
                                            label: '报名活动被录用',
                                            value: '5',
                                            required: true,
                                            addOn: {
                                                label: '星币'
                                            }
                                        }
                                    ]
                                }
                            }

                        ]
                    },

                    {
                        title: '证书设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: "text",
                                name: "cert_title",
                                label: "证书标题"
                            },

                            {
                                type: "text",
                                name: "cert_org",
                                label: "证书机构"
                            },

                            {
                                type: "image",
                                name: "cert_cachet",
                                label: "证书公章"
                            },

                            {
                                type: "text",
                                name: "cert_auth_org",
                                label: "证书认证机构"
                            }
                        ]
                    },

                    {
                        title: '模块设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [

                            {
                                type: "module-settings",
                                name: "modules",
                                label: false,
                                className: 'm-t-md',
                                source: '/api/module/options?_=${_}',
                                required: true
                            }
                        ]
                    },

                    {
                        title: '服务中心设置',
                        collapsed: true,
                        bodyClassName: 'wrapper',
                        controls: [
                            {
                                type: "rich-text",
                                name: "org_info",
                                label: '平台介绍'
                            },

                            {
                                type: "rich-text",
                                name: "org_manual",
                                label: '使用帮助'
                            },

                            {
                                type: "rich-text",
                                name: "org_service",
                                label: '客服中心'
                            },

                            {
                                type: 'text',
                                name: 'org_service_tel',
                                label: '客服电话',
                                validations: 'isPhone'
                            },

                            {
                                type: "rich-text",
                                name: "org_service_guide",
                                label: '修改个人信息引导'
                            },
                        ]
                    }
                ]
            }
        }
    ]
};
